#include<func.h>
int main()
{
    int fds[2];
    pipe(fds);
    char buf[1024]={0};
    int ret;
    if(fork())
    {
        
        close(fds[1]);
        ret=read(fds[0],buf,sizeof(buf));
        ERROR_CHECK(ret,-1,"read");
        printf("I am parent,child say: %s\n",buf);
        wait(NULL);
        return 0;

    }
    else
    {
        close(fds[0]);
        write(fds[1],"hello",5);
        return 0;
        
    }
}